//main 仓库

//defindStore 定义仓库函数
import { defineStore } from 'pinia'

// 定义仓库 & 导出仓库
export const fanQieSettingStore = defineStore('setStore',{
    state:()=>{
        return{
            num: 10,
            token: ''
        }
    },
    getters:{
        doubleNum(){
            return this.num * 2
        }
    },
    actions:{
        addNum(){
            this.num ++
        },
        asyncAddNum(){
            return new Promise(resolve => {
                setTimeout(()=>{
                    this.num += 2
                    resolve
                },2000)
            })
        }
    }
})